<template>
  <el-image-viewer
    v-if="visible"
    :url-list="imageUrls"
    :on-close="closeViewer"
  />
</template>
<script>

import ElImageViewer from 'element-ui/packages/image/src/image-viewer'

export default {
  name: 'ImagePreviewer',
  components: { ElImageViewer },
  data () {
    return {
      visible: false,
      imageUrls: []
    }
  },
  methods: {
    show (urls) {
      this.imageUrls = urls
      this.visible = true
    },
    closeViewer () {
      this.visible = false
    }
  }
}
</script>
